Skip to content

feat(keyless): pure RFC 9421 HTTP Message Signatures core (Pillar 2 keyless step 1) - #322

Merged
sandstream merged 1 commit into
mainfrom
claude/web-kit-status-sync-p6fg9a
Jul 10, 2026
Merged

sandstream merged 1 commit into
mainfrom
claude/web-kit-status-sync-p6fg9a

Conversation

@sandstream

Copy link
Copy Markdown
Owner

First increment of the "sign, don't store" keyless-credential story (design note: kit-research #39). Instead of carrying a long-lived bearer token, an agent signs each outbound request with its Ed25519 identity (Pillar 1); the server verifies against the public key — nothing at rest to steal, rotate, or redact.

What

src/keyless/http-sig.ts — the deterministic, zero-I/O RFC 9421 core:

  • componentValue — derives @method / @authority / @path / @query / @scheme / @target-uri and header components (case-insensitive, OWS-trimmed).
  • signatureParamsValue + signatureBase — the canonical @signature-params value and the §2.5 signature base, byte-for-byte stable across machines.
  • signRequest → { Signature-Input, Signature }; verifyRequest → fail-closed VerifyResult.
  • Signing/verifying take injected sign / resolvePub / verify callbacks, so the same primitive serves the broker (Ed25519 signWithIdentity, wired in step 2) and tests (ephemeral keypair). No filesystem, no network, no identity import, no model calls — stays inside the zero-LLM boundary and verifies offline.

Fail-closed

Missing covered component, unresolvable keyid, expired signature, alg != ed25519, an uncovered required component, or a base that doesn't verify all return valid:false. Nothing but valid:true is proof of identity.

Verification

  • npx tsc --noEmit clean · npx eslint src 0 errors (124 pre-existing warnings)
  • 17 new unit tests (component derivation, serialization determinism, round-trip, tamper/expiry/unknown-keyid/required-component rejection)
  • node scripts/test.mjs — 2758/2758 pass, 0 fail · prettier applied

Next: step 2 wires this into the exec-broker egress path (a sign host mints these headers from the identity instead of injecting a stored bearer) + a kit doctor keyless-posture row.

🤖 Generated with Claude Code


Generated by Claude Code

…eyless step 1)

First increment of the "sign, don't store" keyless-credential story: a
deterministic, zero-I/O core that builds the RFC 9421 signature base and
assembles/verifies the Signature-Input + Signature headers.

- src/keyless/http-sig.ts: componentValue (@method/@authority/@path/@query/
  @scheme/@target-uri + header components), signatureParamsValue, signatureBase
  (§2.5), signRequest, verifyRequest. Signing/verifying take injected sign/
  resolvePub/verify callbacks so the same primitive serves the broker (Ed25519
  signWithIdentity) and tests (ephemeral keypair). No filesystem, no network, no
  identity import, no model calls — stays inside the zero-LLM boundary and
  verifies offline across machines.
- Fail-closed: missing covered component, unresolvable keyid, expired signature,
  alg != ed25519, uncovered required component, or a base that doesn't verify all
  return valid:false. Nothing but valid:true is proof of identity.
- 17 unit tests: component derivation, base/param serialization determinism,
  sign+verify round-trip, and tamper/expiry/unknown-keyid/required-component
  rejection.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DbF4MFePXWNCd4dxBQvqH2
@github-actions

Copy link
Copy Markdown

✅ Docker image built successfully

  • CLI image: docker.io/sandstream/kit:test

@sandstream
sandstream merged commit a5fb9bd into main Jul 10, 2026
18 checks passed
@sandstream
sandstream deleted the claude/web-kit-status-sync-p6fg9a branch July 10, 2026 19:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants